echo {e..q}{a,b,c,d} qr qs|xargs -n1|shuf|awk '{if (NR<4){d=d" "$0;next}a[NR%3]=a[NR%3]?a[NR%3]" "$0:$0}END{
    for (i in a) {
        split(a[i],b," ");
        slen=asort(b,tA);
        for (j = 1; j <= length(b); j++){ 
            l1 = substr(tA[j],1,1);
            l2 = substr(tA[j],2,1);
            tmp[i] = l2""l1" "tmp[i]
        }
    
        split(d,t," ");
        for(k = 1; k <= length(t); k++) {
            l1 = substr(t[k],1,1);
            l2 = substr(t[k],2,1);
            dd = dd" "l2""l1
        }
        if (i == 0) {
            res = "地主 "tmp[i]"\t地主牌: "dd
        } else {
            res = "玩家"i" "tmp[i]
        }
    
        gsub("rq","小王",res)
        gsub("sq","大王",res)
        gsub("d","黑桃",res)
        gsub("c","红桃",res)
        gsub("b","梅花",res)
        gsub("a","方块",res)
        gsub("q","2",res)
        gsub("p","A",res)
        gsub("o","K",res)
        gsub("n","Q",res)
        gsub("m","J",res)
        gsub("l","10",res)
        gsub("k","9",res)
        gsub("j","8",res)
        gsub("i","7",res)
        gsub("h","6",res)
        gsub("g","5",res)
        gsub("f","4",res)
        gsub("e","3",res)
        print res
    }
}'
